//package cn.wp.common.core.web.interceptor;
//
//
//import cn.hutool.core.date.DateUtil;
//import cn.hutool.core.util.StrUtil;
//import cn.wp.common.core.Wp;
//import cn.wp.common.core.WpVar;
//import cn.wp.common.core.authentication.AuthenticationContext;
//import cn.wp.common.core.authentication.AuthenticationInfo;
//import cn.wp.common.core.dto.AccessLogDto;
//import cn.wp.common.core.dto.WpResult;
//import cn.wp.common.core.id.Id;
//import cn.wp.common.core.util.IpUtil;
//import cn.wp.common.core.util.ResponseUtil;
//import cn.wp.common.core.web.WpWebContext;
//import org.springframework.web.method.HandlerMethod;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.PrintWriter;
//import java.io.StringWriter;
//
///**
// * 渲染拦截器
// * Created by chenyb on 2019-10-14
// */
//public class RenderInterceptor extends WpAbstractInterceptor {
//
//    public RenderInterceptor(String[] pathPatterns, String[] ignores) {
//        super(pathPatterns, ignores);
//    }
//
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler){
//        return  true;
//    }
//
//    @Override
//    public void finalHandle(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
//        String bodyType = request.getParameter(WpVar.WP_RESPONSE_BODY_TYPE);
//        if(StrUtil.isBlank(bodyType)){
//            bodyType = WpVar.WP_RESPONSE_JSON_BODY;
//        }
//
//        if(bodyType.equals(WpVar.WP_RESPONSE_JSON_BODY)){
//            WpResult wpResult = new WpResult();
//            HandlerMethod handlerMethod = WpWebContext.getMethodHandler();
//            if(handlerMethod != null){
//                handlerMethod.getreturn
//                ResponseUtil.writeJson(response,);
//            }
//        }
//    }
//}